import 'package:flutter/material.dart';
import 'package:mi_mang_flutter/widget/ui/shadow_card.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:mi_mang_flutter/res/styles.dart';

/// 首次加载正在加载组件
class WidgetFirstRefresh extends StatelessWidget {
  const WidgetFirstRefresh({Key? key, this.loadingText = "加载中..."})
      : super(key: key);

  /// 提示文字
  final String loadingText;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //创建透明层
      resizeToAvoidBottomInset: false,
      backgroundColor: Colors.transparent,
      body: Container(
        //decoration: new BoxDecoration(
        //  color: Colours.bg_color,
        //),
        width: double.infinity,
        height: double.infinity,
        child: Center(
          child: SizedBox(
            height: 100.0,
            width: 100.0,
            child: ShadowCard(
              color: Colors.black87,
              margin: EdgeInsets.zero,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  SpinKitPouringHourGlass(
                    color: Colors.white,
                    size: 35.0,
                  ),
                  Gaps.vGap12,
                  Container(
                    child: Text(
                      loadingText,
                      style: TextStyle(color: Colors.white),
                    ),
                  )
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
